fix(installer): resolve PowerShell 5.1 compatibility and restore uninstall.ps1#158
Open
muhammadGagah wants to merge 1 commit into
Open
Conversation
….ps1 for PowerShell 5.1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses two critical installation and maintenance issues on Windows environments running classic Windows PowerShell 5.1 (the default pre-installed shell on Windows 10 and 11):
Changes Made
1. Fix Join-Path positional arguments in install.ps1
Join-Pathonly supports joining up to two path segments (Path and ChildPath). Passing additional positional arguments (e.g.Join-Path $WorkingDir "node_modules" $ModuleName "package.json") throws a terminatingPositionalParameterNotFoundexception.Test-NodeModuleAvailableto join the child paths into a single interpolated string:2. Restore and Harden uninstall.ps1
gh skillflow. However, theinstall.ps1success message andREADME.mdstill instruct users to run:uninstall.ps1from the repository history and hardened it:Stop-RunningMcpProcesseshelper that uses WMI (Get-CimInstance Win32_Process) to safely query and terminate any activenode.exeprocesses runningserver.jsfrom the target MCP installation directories. This prevents theRemove-Itemfile-lock exception that previously occurred if the MCP server was running.Remove-Itemdirectory deletions intry/catchblocks. If folders remain locked by other applications (e.g. an open File Explorer window or a terminal set to that directory), the script now prints a clear instruction asking the user to close those programs, rather than crashing with a raw PowerShell stack trace.Why the Uninstaller Script Should Be Kept
While the project is standardizing on the new
gh skillcommand structure, keeping the standaloneuninstall.ps1(anduninstall.sh) is still necessary for the following reasons:gh skilltransition or those who run the manual script (install.ps1) need a corresponding uninstaller to clean up files.gh skillcommand group is currently in preview, and some versions do not contain anuninstallorremovesubcommand, leaving manual cleanup as the only recourse.~/.claude/,~/.codex/,~/.gemini/, and~/.a11y-agent-team/) can be cleared out reliably without forcing the user to find and delete directories manually.Recommendations for Further Review
The following areas are recommended for developer review and are not included in this PR:
1. Fix gh skill Subcommand Assumptions
The documentation in
UNINSTALL.mdanddocs/GH-SKILL-MIGRATION.mdreferences the commandgh skill uninstall. However, the current GitHub CLIgh skillsubcommand set only containsinstall,list,preview,publish,search, andupdate(nouninstallorremoveexists). The development team should either:uninstallto the upstreamgh-skillCLI extension.gh extension remove gh-skillor manual directory cleanup.2. Update Installer Output and Documentation
If the team still intends to deprecate standalone uninstaller scripts:
irm ... uninstall.ps1 | iexcommand printout from the success screen ofinstall.ps1.README.mdandUNINSTALL.mdto remove dead script links.3. Review Bash Scripts (
install.shanduninstall.sh)lsoforfuserequivalent) inuninstall.shto prevent similar file-lock errors when removing the global MCP server folder on macOS/Linux.Thank you.